package com.ce.source.analysis.lifecycle.spring;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author ：前世小和尚（xiaopingzhang8@creditease.cn）
 * @Description ：spring生命周期测试
 * @ClassName ：SpringLifeCycle
 * @Company ：普信恒业科技发展（北京）有限公司
 * @date ：2018/1/29 13:09
 */

/**
 * <p>Spring生命周期</p>
 * <pre>
 *     1.BeanFactoryPostProcessor实现类构造器
 *     2.BeanFactoryPostProcessor调用postProcessBeanFactory方法
 *     3.BeanPostProcessor实现类构造器
 *     4.InstantiationAwareBeanPostProcessorAdapter实现类构造器
 *     5.InstantiationAwareBeanPostProcessorAdapter.postProcessBeforeInstantiation方法
 *     6.调用bean的无参构造器
 *     7.InstantiationAwareBeanPostProcessorAdapter.postProcessAfterInstantiation方法
 *     8.InstantiationAwareBeanPostProcessorAdapter.postProcessPropertyValues设置属性
 *     9.[BeanNameAware]调用setBeanName()设置bean名称
 *     10.[BeanFactoryAware]调用setBeanFactory()设置bean工厂
 *     11.BeanPostProcessor.postProcessBeforeInitialization()对属性进行修改--初始化之前属性设置
 *     12.InstantiationAwareBeanPostProcessorAdapter.postProcessBeforeInitialization初始化之前
 *     13.[InitializingBean]调用afterPropertiesSet设置属性
 *     14.调用手动初始化方法init-method
 *     15.BeanPostProcessor.postProcessAfterInitialization()对属性进行修改--初始化之后属性修改
 *     16.业务处理
 *     17.关闭容器，执行[DisposableBean]调用destroy()销毁
 *     18.执行手动destroy-method
 * </pre>
 */
public class SpringLifeCycle {
    private static final Logger log = LoggerFactory.getLogger(SpringLifeCycle.class);
    public void sayHello(){
        log.info("hello world!");
    }
}
